// pages/setup/setup.js
 const util= require('../../utils/util')

Page({

  /**
   * Page initial data
   */
  data: {

  },

  logout(){
    wx.showModal({
      title: '温馨提示',
      content: '确定要退出当前账号？',
      complete: (res) => {
        if (res.cancel) {
          
        }
    
        if (res.confirm) {
         util.token="",
         util.phone="",
         util.name='',
         util.ROLE=0,
         util.transfer_permission=[],
         util.findshop_permission=[],
         util.finance_permission=[],
         util.staff_picture="",
         util.branch_id='',
         util.UserInviteCode=undefined

         wx.reLaunch({
           url: '../login/login',
         })
        }
      }
    })
  },

  modifyPw(){
     wx.navigateTo({
       url: '../modifyPw/modifyPw',
     })
  },

  /**
   * Lifecycle function--Called when page load
   */
  onLoad(options) {

  },

  /**
   * Lifecycle function--Called when page is initially rendered
   */
  onReady() {

  },

  /**
   * Lifecycle function--Called when page show
   */
  onShow() {

  },

  /**
   * Lifecycle function--Called when page hide
   */
  onHide() {

  },

  /**
   * Lifecycle function--Called when page unload
   */
  onUnload() {

  },

  /**
   * Page event handler function--Called when user drop down
   */
  onPullDownRefresh() {

  },

  /**
   * Called when page reach bottom
   */
  onReachBottom() {

  },

  /**
   * Called when user click on the top right corner to share
   */
  onShareAppMessage() {

  }
})